<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>

<body>
<nav th:replace="layouts::navbar"></nav>
<div class="container">
    <h4>评论列表</h4>
    <hr>
    <!-- 新增评论按钮-->
    <a th:href="@{/interactions/new}" class="btn btn-primary btn-sm mb-3">添加评论</a>
    <br>
    <table class="table-bordered table-striped">
        <thead class="thead-dark">
        <tr>
            <th>昵称</th>
            <th>发布者ID</th>
            <th>评论标题</th>
            <th>评论</th>
            <th>动作</th>

        </tr>
        </thead>
        <tbody>
        <tr th:each="aInteraction : ${interactions}">
            <td th:text="${aInteraction.username}"></td>
            <td th:text="${aInteraction.unitId}"></td>
            <td th:text="${aInteraction.title}"></td>
            <td th:text="${aInteraction.comment}"></td>
            <td>
<!--                <a th:href="@{/interactions/update(id=${aInteraction.interactionId})}" class="btn btn-info btn-sm">编辑</a>-->
                <a
                        th:href="@{/interactions/delete(id=${aInteraction.interactionId})}"
                        class="btn btn-danger btn-sm"
                        onclick="if (!(confirm('你确定去删除这个评论吗'))) return false"
                >删除</a>
            </td>


        </tr>
        </tbody>
    </table>
</div>


</body>
</html>